/**
 * There are <a href="https://github.com/thinkgem/jeesite">JeeSite</a> code generation
 */
package com.chlitina.store.modules.sms.entity;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import com.chlitina.store.common.persistence.BaseEntity;

/**
 * 店面诊断结果详细Entity
 * @author liujiang
 * @version 2013-08-01
 */
@Entity
@Table(name = "store_diagnose_detail")
@IdClass(DiagnoseStorePK.class)
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class StoreDiagnoseDetail extends BaseEntity {
	
	private static final long serialVersionUID = 1L;
	private StoreDiagnose storeDiagnose; 		//店面诊断编号
	private StoreDiagnoseTemplateDetail storeDiagnoseTemplateDetail; 		// 用户
	private Float real_value; 	//实际值
	private Float score; //得分（计算得到）

	public StoreDiagnoseDetail() {
	}

	public StoreDiagnoseDetail(Long id){
		this();
	}
	
	@Id
	@ManyToOne(cascade={CascadeType.REFRESH},fetch = FetchType.LAZY)
	@JoinColumn(name="SD_ID")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	@NotNull
	public StoreDiagnose getStoreDiagnose() {
		return storeDiagnose;
	}

	public void setStoreDiagnose(StoreDiagnose storeDiagnose) {
		this.storeDiagnose = storeDiagnose;
	}

	@Id
	@ManyToOne(cascade={CascadeType.REFRESH},fetch = FetchType.LAZY)
	@JoinColumn(name="SDTD_ID")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	@NotNull
	public StoreDiagnoseTemplateDetail getStoreDiagnoseTemplateDetail() {
		return storeDiagnoseTemplateDetail;
	}

	public void setStoreDiagnoseTemplateDetail(StoreDiagnoseTemplateDetail storeDiagnoseTemplateDetail) {
		this.storeDiagnoseTemplateDetail = storeDiagnoseTemplateDetail;
	}

	public Float getReal_value() {
		return real_value;
	}

	public void setReal_value(Float real_value) {
		this.real_value = real_value;
	}

	public Float getScore() {
		return score;
	}

	public void setScore(Float score) {
		this.score = score;
	}
}